package com.example.redisdemo1.Controller;


import com.example.redisdemo1.Service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StudentController {
    @Autowired
    StudentService studentService;
    @GetMapping("/select")
    public Object select(){
        return studentService.select();
    }
    @GetMapping("/sum")
    public Integer scoreSum(){
        return Integer.valueOf(studentService.sum());
    }
    @GetMapping("/delete")
    public Object delete(){
        studentService.delete();
        return "OK";
    }
}
